package com.hqd.ch03.v11.spel.parse;


import com.hqd.ch03.v11.spel.ParserContext;

/**
 * Spel表达式默认模板，以#{}包裹的内容
 */
public class TemplateParserContext implements ParserContext {
    private final String expressionPrefix;

    private final String expressionSuffix;

    public TemplateParserContext() {
        this("#{", "}");
    }

    public TemplateParserContext(String expressionPrefix, String expressionSuffix) {
        this.expressionPrefix = expressionPrefix;
        this.expressionSuffix = expressionSuffix;
    }

    @Override
    public boolean isTemplate() {
        return true;
    }

    @Override
    public String getExpressionPrefix() {
        return expressionPrefix;
    }

    @Override
    public String getExpressionSuffix() {
        return expressionSuffix;
    }
}
